import { ChipColors } from '../const/colors.const'

export type Card = string
export type Player = Card[]

export const getDefaultCards = () => {
    const numbers = [
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        'J',
        'Q',
        'K',
        'A'
    ]
    const characters = ['@', '#', '^', '*']
    let cards = []
    for (let num of numbers) {
        for (let char of characters) {
            cards.push(`${num}${char}`)
        }
    }
    return cards
}

export const getDefaultPlayerCards = () => {
    const players: Player[] = [[], [], [], []]
    return players
}

export const getChipColors = (cardValue: string) => {
    const firstChar = Array.from(cardValue)[0]
    return ChipColors[firstChar]
}
